

// 使用数组来代替哈希表
bool isIsomorphic(char* s, char* t) {
    char s2tMap[128] = {0};
    char t2sMap[128] = {0};

    for (int i = 0; s[i] != '\0'; i++) {
        char sc = s[i];
        char tc = t[i];

        if ((s2tMap[sc] != NULL && s2tMap[sc] != tc) ||
            (t2sMap[tc] != NULL && t2sMap[tc] != sc)) {
            return false;
        }

        s2tMap[sc] = tc;
        t2sMap[tc] = sc;
    }

    return true;
}